#include "mainwindow.h"
#include "ui_mainwindow.h"



MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    mpGraphicsColorizeEffect= new QGraphicsColorizeEffect(this);
    ui->label->setGraphicsEffect(mpGraphicsColorizeEffect);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_horizontalSlider_valueChanged(int value)
{
    mpGraphicsColorizeEffect->setStrength(value/100.0);
}

void MainWindow::on_pushButton_clicked()
{
    QColorDialog colorDialog;
    //colorDialog.setOption(QColorDialog::NoButtons,1);
    colorDialog.exec();
    qDebug()<<colorDialog.currentColor();
    mpGraphicsColorizeEffect->setColor(colorDialog.currentColor());
}

